function [Conditions,ceq] = parameterfun(x,n,var_num,Pv,Lambdav,b)
Conditions= zeros(n,1) ;
for i=1:n-1
    incr=n+(i*(i+1)/2);
    for k=i:n-1
        Conditions(i)= (Pv(k)*x(k)-Pv(k)-Pv(k+1)*x(k+1))*x(incr)+ Conditions(i);
        incr=incr+k-1;
    end 
    Conditions(i)=(Pv(n)*x(n)-Pv(n)-Pv(1)*x(1))*x(incr) +Conditions(i);
    Conditions(i)=Conditions(i)*Lambdav+b(i)+x(var_num);
end
incr=var_num-1;
Conditions(n) =Lambdav*(Pv(n)*x(n)-Pv(n)-Pv(1)*x(1))*x(incr) + b(n)+ x(var_num);
ceq=[];
end